<?php
namespace app\api\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'username'  => 'require|max:35',
        'nickname'  => 'require|max:35',
        'password'  => 'require',
        'team'  => 'require',
        'qq'  => 'require',
        'sex'  => 'require',

    ];
    protected $message = [
        'username.require'  =>  '用户名不能为空',
        'username.max'      =>  '用户名不能超过35个字符',
        'nickname.require'  =>  '游戏ID不能为空',
        'nickname.max'      =>  '游戏ID不能超过35个字符',
        'password.require'  =>  '密码不能为空',
        'team.require'      =>  '请选择您的所属氏族',
        'qq.require'        =>  'QQ不能为空',
        'sex.require'       =>  '请选择您的性别',
    ];
    protected $scene =[
        'login'     => ['username','password'],
        'register'  => ['username','password','nickname','team','qq','sex'],
        'editProfile'      => ['nickname','team','sex','qq','username']
    ];
}